package com.mobor.moborsvr.obj.category.service.impl;

import java.util.Collections;
import java.util.List;

import com.mobor.moborsvr.infra.dao.BaseWorker;
import com.mobor.moborsvr.obj.category.dao.CategoryObjectRepository;

public class CategoryObjectSearchWorker implements BaseWorker {
	
	private Long objectId;
	
	private CategoryObjectRepository categoryObjectRepository;

	@Override
	public List<?> work() {
		if(this.objectId != null)
			return Collections.singletonList(categoryObjectRepository.findOne(this.objectId));
		
		return categoryObjectRepository.findAll();
	}

}
